package com.wing.cabinet.model.response;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.wing.cabinet.model.entity.CheckedResult;
import com.wing.cabinet.utils.ExcelExport;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 盘验结果表VO
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class InspectionAndRepairExportVO {

    /**
     * ID
     */
    private Long id;

    /**
     * 创建时间
     */
    @ExcelExport(value = "盘验时间",sort = 130)
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime createTime;

    /**
     * 创建人
     */
    @ExcelExport(value = "盘验人",sort = 120)
    private String creatorName;

    /**
     * 状态
     */
   // @ExcelExport(value = "盘验状态",sort = 11,kv = "created-待盘验;checked-已盘验")
    private CheckedResult.Status status;

    /**
    * 状态描述
    */
    @TableField(exist = false)
    private String statusDesc;

    public String getStatusDesc() {
        return status.getDesc();
    }

    /**
     * 货物状态
     */
    @ExcelExport(value = "盘验后状态",sort = 110,kv = "temp-暂存;repair-报修;recycle-报废")
    private CheckedResult.BusinessType businessType;

    /**
    * 货物状态描述
    */
    @TableField(exist = false)
    private String businessTypeDesc;

    public String getBusinessTypeDesc() {
        if (businessType!=null){
            return businessType.getDesc();
        }
        return null;
    }

    /**
     * 盘验数量
     */
    @ExcelExport(value = "数量",sort = 90)
    private Integer quantity;

    /**
     * sku code
     */
    @ExcelExport(value = "物料编号",sort = 20)
    private String skuCode;

    /**
     * 柜子编号
     */
    @ExcelExport(value = "柜子编号",sort = 60)
    private String cabCode;

    /**
     * 库位编号
     */
    @ExcelExport(value = "货位编号",sort = 80)
    private String spaceCode;

    /**
     * 车间名称
     */
    private String workshopName;

    @ExcelExport(value = "盘验编号",sort = 50)
    private String code;

    /**
     * 产品SKU名称
     */
    @ExcelExport(value = "物料名称",sort = 10)
    private String skuName;

    /**
     * 产品名称
     */
    private String productName;

    /**
     * 产品类型名称
     */
    private String productTypeName;

    /**
     * 产品分类名称
     */
    private String productCategoryName;

    /**
     * 产品品牌
     */
    @ExcelExport(value = "品牌",sort = 40)
    private String productBrandName;

    /**
     * 产品型号
     */
    private String productModelName;

    /**
     * 适配机床
     */
    private String deviceName;

    /**
     * 市场价
     */
    private BigDecimal marketPrice;

    private Integer quantityMax;

    /**
     * 单位
     */
    private String unitName;


    /**
     * 柜子名称
     */
    @ExcelExport(value = "企业自定义名称",sort = 70)
    private String cabName;

    private String notifyUserName;

    /**
     * 供应商名称
     */
    private String supplierName;

    @ExcelExport(value = "盘验前状态",sort = 100,kv = "losed-缺失;temp-暂存;repair-报修;recycle-报废")
    private CheckedResult.BusinessTypePre businessTypePre;

    private String businessTypePreDesc;

    public String getBusinessTypePreDesc(){
        if (this.businessTypePre!=null){
            return this.businessTypePre.getDesc();
        }
        return "";
    }

    @ExcelExport(value = "是否已生成订单",sort = 140,kv = "true-是;false-否")
    private Boolean isGenOrder;

    /**
     * 是否相符
     */
    private Boolean isCorrect;

    private Boolean isStorage;

    @ExcelExport(value = "规格码",sort = 30)
    private String skuSpecOld;

    private String skuCodeOld;

    private Long checkId;

    private Boolean businessTypeCorrect;

    private Boolean skuCorrect;

    /**
     * 企业编码
     */
    private String enterpriseCode;

    private String remark;

    private String roleName;
    @ExcelExport(value = "部门",sort = 51)
    private String departmentName;

    private String inCreatorName;

    private String inCreatorImg;

    private Long departmentId;
    @ExcelExport(value = "成本中心",sort = 52)
    private String costCenter;

}
